package com.wmx.controller;

import cn.hutool.extra.spring.SpringUtil;
import com.wmx.entity.ResultData;
import com.wmx.entity.Tv;
import com.wmx.service.TvService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * HuTool 工具类测试
 *
 * @author wangMaoXiong
 * @version 1.0
 * @date 2024/7/19 10:23
 */
@RestController
public class HuToolController {

    /**
     * http://localhost:8080/huTool/tv/findAll
     * 查询所有 Tv
     */
    @GetMapping("huTool/tv/findAll")
    @ResponseBody
    public ResultData findAllTv() {
        TvService tvService = SpringUtil.getBean(com.wmx.service.TvService.class);
        List<Tv> tvList = tvService.findAll();
        return ResultData.success(tvList);
    }

}
